import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import chapter1 from './chapter1'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/chapter1/first-scene',
    meta: {
      title: '第一节课程'
    }
  },
  ...chapter1
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

router.beforeEach((to) => {
  document.title = `three+v3+ts${to.meta.title}`
})

export default router
